# convert_to_jsonl.py
input_file = "data/my_tiny_dataset.txt"
output_file = "data/my_tiny_dataset.jsonl"

with open(input_file, 'r', encoding='utf-8') as fin, \
     open(output_file, 'w', encoding='utf-8') as fout:
    for line in fin:
        line = line.strip()
        if line:  # 忽略空行
            fout.write(f'{{"text": "{line}"}}\n')